export function useTime() {
    const formatTime = (time: number) => {
        let date = new Date(time);
        let year = date.getFullYear();
        let month = date.getMonth() + 1;
        let day = date.getDate();
        let hour = date.getHours();
        let minute = date.getMinutes();
        let second = date.getSeconds();
        let dateStr = 
            year + '-' + 
            `${month > 10 ? month : `0${month}`}` + '-' + 
            `${day > 10 ? day : `0${day}`}` + ' ' + 
            `${hour > 10 ? hour : `0${hour}`}` + ':' + 
            `${minute > 10 ? minute : `0${minute}`}` + ':' + 
            `00`;
        return dateStr
    };

    return {
        formatTime,
    };
  }
  